﻿<%@ Page Title="" Language="C#" MasterPageFile="~/BackEnd/BackEndMasterPage.Master" AutoEventWireup="true"
    CodeBehind="InsertNation.aspx.cs" Inherits="AteneoLibri.BackEnd.InsertNation" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Inserisci nazione
    </h2>
    <asp:Panel ID="pnlInsertNation" runat="server" DefaultButton="btnInsertNation">
        <h3>
            Inserisci la nuova nazione</h3>
        <div>
            <asp:TextBox ID="txtNationName" runat="server" CssClass="StandardTextBox" Height="20px"
                ValidationGroup="vgNewNation"></asp:TextBox>
            <asp:Button ID="btnInsertNation" runat="server" CssClass="StandardButton" Text="Inserisci"
                OnClick="btnInsertNation_Click" ValidationGroup="vgNewNation" />
        </div>
        <div>
            <asp:RequiredFieldValidator ID="rfvNation" runat="server" ErrorMessage="* Campo obbligatorio"
                ValidationGroup="vgNewNation" ControlToValidate="txtNationName" Display="Dynamic"
                CssClass="failureNotification"></asp:RequiredFieldValidator>
        </div>
    </asp:Panel>
    <div style="margin-top: 20px;">
        <h3>
            Elenco delle nazioni inserite</h3>
        <asp:Panel ID="pnlNations" runat="server">
            <asp:GridView ID="gvNations" runat="server" OnPageIndexChanging="gvNations_PageIndexChanging"
                EmptyDataText="Non ci sono nazioni presenti nel database" AllowPaging="true"
                AlternatingRowStyle-BackColor="#cccccc" BackColor="#ffffff" CellPadding="2" AutoGenerateColumns="false"
                ShowFooter="true" DataKeyNames="IdNation" PageSize="5" EmptyDataRowStyle-ForeColor="Red">
                <Columns>
                    <asp:BoundField HeaderText="Nazione" ReadOnly="true" DataField="Description" ItemStyle-Width="200px" ItemStyle-Height="25px" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:ImageButton ID="btnDeleteNation" runat="server" CssClass="metroButton" AlternateText="Cancella la nazione"
                                ImageUrl="~/Images/deleteIcon.png" OnClick="btnDeleteNation_Click" CommandArgument='<%# Eval("IdNation") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </asp:Panel>
    </div>
</asp:Content>
